﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SPMS.Log.ObjectFormatter
{
    /// <summary>
    /// 对象格式化器接口
    /// </summary>
    /// <remarks>用于将对象格式化为适合日志输出的描述信息</remarks>
    /// <history>
    /// [zanezeng]               2009/9/29 11:49    创建
    /// </history>
    public interface IObjectFormatter
    {
        /// <summary>
        /// 将指定的对象格式化为字符串
        /// </summary>
        /// <param name="provider">对象格式化器提供者</param>
        /// <param name="obj">要格式化的对象</param>
        /// <returns>给定对象的字符串描述信息</returns>
        /// <remarks></remarks>
        /// <exception cref="ArgumentNullException"><paramref name="provider"/>为<c>null</c>引用。</exception>
        /// <history>
        /// [zanezeng]               2009/9/29 11:49    创建
        /// </history>
        string Format( IObjectFormatterProvider provider, object obj );


        /// <summary>
        /// 将指定的对象格式化为字符串
        /// </summary>
        /// <param name="provider">对象格式化器提供者</param>
        /// <param name="obj">要格式化的对象</param>
        /// <param name="format">对象的格式化字符串</param>
        /// <returns>给定对象的字符串描述信息</returns>
        /// <remarks></remarks>
        /// <exception cref="ArgumentNullException"><paramref name="provider"/>为<c>null</c>引用。</exception>
        /// <history>
        /// [zanezeng]               2009/10/20 10:57    创建
        /// </history>
        string Format( IObjectFormatterProvider provider, object obj, string format );

        /// <summary>
        /// 将指定的对象格式化为字符串
        /// </summary>
        /// <param name="provider">对象格式化器提供者</param>
        /// <param name="obj">要格式化的对象</param>
        /// <param name="formatProvider">格式化提供者，提供用于检索控制格式化的对象的机制</param>
        /// <returns>给定对象的字符串描述信息</returns>
        /// <remarks></remarks>
        /// <exception cref="ArgumentNullException"><paramref name="provider"/>为<c>null</c>引用。</exception>
        /// <history>
        /// [zanezeng]               2009/10/20 10:57    创建
        /// </history>
        string Format( IObjectFormatterProvider provider, object obj, IFormatProvider formatProvider );

        /// <summary>
        /// 将指定的对象格式化为字符串
        /// </summary>
        /// <param name="provider">对象格式化器提供者</param>
        /// <param name="obj">要格式化的对象</param>
        /// <param name="format">对象的格式化字符串</param>
        /// <param name="formatProvider">格式化提供者，提供用于检索控制格式化的对象的机制</param>
        /// <returns>给定对象的字符串描述信息</returns>
        /// <remarks></remarks>
        /// <exception cref="ArgumentNullException"><paramref name="provider"/>为<c>null</c>引用。</exception>
        /// <history>
        /// [zanezeng]               2009/10/20 10:57    创建
        /// </history>
        string Format( IObjectFormatterProvider provider, object obj, string format, IFormatProvider formatProvider );
    }
}
